package jusda.caa.minio.config;

import java.io.Serializable;

public class BaseResult<T> implements Serializable {
	private static final long serialVersionUID = 4687709246031393636L;

	private boolean succ;
	private int errCode;
	private String errMsg;
	private String message;
	private T data;
	private long total;

	public BaseResult(boolean succ, int errCode, String errMsg, String message, T data, long total) {
		this.succ = succ;
		this.errCode = errCode;
		this.errMsg = errMsg;
		this.message = message;
		this.data = data;
		this.total = total;
	}

	public BaseResult(int errCode, String errMsg) {
		this.errCode = errCode;
		this.errMsg = errMsg;
		this.succ = false;
	}

	public BaseResult(T data, long total) {
		this.data = data;
		if (total >= 0) {
			this.total = total;
		}
		this.succ = true;
	}

	public BaseResult() {

	}

	public boolean isSucc() {
		return succ;
	}

	public void setSucc(boolean succ) {
		this.succ = succ;
	}

	public int getErrCode() {
		return errCode;
	}

	public void setErrCode(int errCode) {
		this.errCode = errCode;
	}

	public String getErrMsg() {
		return errMsg;
	}

	public void setErrMsg(String errMsg) {
		this.errMsg = errMsg;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}
}